using System;
using Godot.Collections;

public class Player
{
    public long roomid;
    public int chessman;
    public bool matching = false;
    public bool ingame = false;
    public long id;
    public string name;
    public int point;
    public int firstchessman;
    public void SetFirstChessman(int v)
    {
        firstchessman= v;
        chessman=v;
    }
    public Player Parse(Dictionary dict)
    {
        id = (long)dict["id"];
        point = (int)dict["point"];
        name = (string)dict["name"];
        ingame = (bool)dict["ingame"];
        matching = (bool)dict["matching"];
        chessman = (int)dict["chessman"];
        firstchessman = (int)dict["firstchessman"];
        return this;
    }
    public Dictionary ToDictionary()
    {
        return new Dictionary()
        {
            {"id",id},
            {"name",name},
            {"point",point},
            {"ingame",ingame},
            {"matching",matching},
            {"chessman",chessman},
            {"firstchessman",firstchessman}
        };
    }
}